package whf.framework.security.service;

import java.util.List;
import java.util.Set;

import whf.framework.exception.DAOException;
import whf.framework.exception.FindException;
import whf.framework.security.entity.Group;
import whf.framework.security.entity.Role;
import whf.framework.security.entity.User;
import whf.framework.service.TreeService;

/**
 * @author wanghaifeng
 * @email king@126.com
 * @modify 2006-05-31
 */
public interface RoleService extends whf.framework.service.Service<Role>, TreeService<Role>{
	/**
	 * @modify wanghaifeng Aug 31, 2006 11:08:24 PM
	 * @param role
	 * @param groups
	 * @throws DAOException
	 */
	public void assignRoleGroups(Role role, List<Group> groups) throws DAOException;
	
	/**
	 * @modify wanghaifeng Oct 5, 2006 7:38:22 AM
	 * @return
	 * @throws FindException
	 */
	public Set<Role> findAnonymousRoles() throws FindException;
	
	/**
	 * 通过用户搜索角色
	 * @modify wanghaifeng Mar 10, 2007 11:18:18 AM
	 * @param user
	 * @return
	 * @throws FindException
	 */
	public Set<Role> findByUser(User user) throws FindException;
	
	/**
	 * 查找角色中的所有用户
	 * @modify wanghaifeng Mar 16, 2007 1:48:34 PM
	 * @param role
	 * @return
	 * @throws FindException
	 */
	public Set<User> findRoleUsers(Role role) throws FindException;
} 